<extend name="Layout:layout_dialog" />
<block name="body_main">
    <form action="{:U('menu_edit_save')}" method="post" class="xsui-form">
        <fieldset>
            <div class="xsui-form-field">
                <label>菜单名称：</label>
                <input type="text" name="title" placeholder="菜单名称" required="required" value="{$data.title}"/>
            </div>
            <div class="xsui-form-field">
                <label>菜单位置：</label>
                <select name="pid" data-url="{:U('get_menu_tree_json')}" data-value="{$data.pid}"></select>
            </div>
            <div class="xsui-form-field">
                <label>链接地址：</label>
                <input type="text" name="link_url" placeholder="链接地址" required="required" value="{$data.link_url}" size="80" />
            </div>
            <div class="xsui-form-field">
                <label>打开目标：</label>
                <input type="text" name="open_target" placeholder="打开目标(_blank,_self等)" value="{$data.open_target}" />
            </div>
            <div class="xsui-form-field">
                <label>菜单代码：</label>
                <input type="text" name="code" placeholder="菜单代码" value="{$data.code}"/>
            </div>            
            <div class="xsui-form-field">
                <label>前台显示：</label>
                <sohtml:radio name="status" items="1:显示;0:隐藏" value="{$data.status|default=1}" />
            </div>
        </fieldset>
        <input type="hidden" name="id" value="{$data.id}" />
        <input type="hidden" name="site_id" value="{$data.site_id}"/>
        <input type="hidden" name="user_name" value="{$data.user_name}"/>
        <button type="submit" class="ui-state-default"><i class="fa fa-save"></i>保存</button>
        <button type="reset" class="ui-state-default">重置</button>
    </form>  
</block>
<block name="body_after">
    <script>
        $(function () {
            ajax_combobox({selector: 'select[name="pid"]', def_option: '请选择位置'});
        })
    </script>
</block>